﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HP.Cachalote.Services;
using HP.Cachalote.Services.Interfaces;
using HP.Cachalote.DataModels;
using HP.Cachalote.Repositories.Interfaces;
using HP.Cachalote.Services.Validations;

namespace HP.Cachalote.UnitTests.FakeServices
{
    public class FakeTodoLabelService : FakeServiceBase<TodoLabel>, ITodoLabelService
    {
        private ITodoLabelRepository _todoLabelRepository;

        public FakeTodoLabelService(IRepositoryFactory repositoryFactory)
            : base(repositoryFactory, new TodoLabelValidator()) { }

        /// <summary>
        /// Insert new TodoLabel based on the OrderIndex. Also will reset the others' OrderIndex.
        /// </summary>
        /// <param name="todoLabel">The new inserted TodoLabel with new OrderIndex.</param>
        /// <returns>The id of the new added TodoLabel.</returns>
        public object Insert(TodoLabel todoLabel)
        {
            return RepositoryFactory.CreateTodoLabelRepository().Add(todoLabel);
        }
    }
}